//
//  YoucApi.h
//  YoucApi
//
//  Created by Liam on 12-10-3.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "delegates.h"
#import "YoucApiError.h"

#define YAInvalidSessionNotification			@"YAInvalidSessionNotification"

@class YAReqGameList;
@class YAReqSearchGames;
@class YAReqGameServerList;
@class YAReqUserGetAttention;
@class YAReqUserRegister;
@class YAReqUserLogin;
@class YAReqUserUpdateInfo;
@class YAReqUserAttention;
@class YAReqPutDeviceToken;
@class YAReqSetDND;
@class YAReqWithSession;

@interface YoucApi : NSObject {
	
}

@property (nonatomic, retain) NSString *serverUrl;

// 获取单例
+ (YoucApi*) instance;

// 取消任务
- (void)cancelTask:(id)task;

// 获取开服游戏
- (id)getGameList:(YAReqGameList *)reqGameList context:(id)context delegate:(id<YADelegateGame>)delegate;

// 搜索游戏
- (id)searchGames:(YAReqSearchGames *)reqSearchGames context:(id)context delegate:(id<YADelegateGame>)delegate;

// 获取开服游戏服务器
- (id)getGameServerList:(YAReqGameServerList *)reqGameServerList context:(id)context delegate:(id<YADelegateGame>)delegate;

// 获取推荐开服游戏服务器
- (id)getRecommendList:(id)context delegate:(id<YADelegateGame>)delegate;

// 获取开服游戏服务器
- (id)getAttentionList:(YAReqUserGetAttention *)reqUserGetAttention context:(id)context delegate:(id<YADelegateGame>)delegate;

// 用户注册
- (id)userRegister:(YAReqUserRegister *)reqUserRegister context:(id)context delegate:(id<YADelegateUser>)delegate;

// 用户登录
- (id)userLogin:(YAReqUserLogin *)reqUserLogin context:(id)context delegate:(id<YADelegateUser>)delegate;

// 保持session
- (id)userKeepSession:(YAReqWithSession *)reqUserSession context:(id)context delegate:(id<YADelegateUser>)delegate;

// 获取用户信息
- (id)userGetInfo:(YAReqWithSession *)reqUserSession context:(id)context delegate:(id<YADelegateUser>)delegate;

// 更新用户信息
- (id)userUpdateInfo:(YAReqUserUpdateInfo *)reqUpdateUserInfo context:(id)context delegate:(id<YADelegateUser>)delegate;

// 用户添加关注游戏
- (id)userAddAttention:(YAReqUserAttention *)reqUserAttention context:(id)context delegate:(id<YADelegateUser>)delegate;

// 用户删除关注游戏
- (id)userDeleteAttention:(YAReqUserAttention *)reqUserAttention context:(id)context delegate:(id<YADelegateUser>)delegate;

// 向服务端发送deviceToken
- (id)userPutDeviceToken:(YAReqPutDeviceToken *)reqPutDeviceToken;

// 向服务端设置免打扰
- (id)userSetDND:(YAReqSetDND *)reqSetDND;

// 检查版本
- (id)checkVersion:(NSString *)version context:(id)context delegate:(id<YADelegateClient>)delegate;

@end
